/**
*      author: Y_Yao
*      created: 2025-01-25 19:26:40
**/

#include<bits/stdc++.h>

//#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 100 + 7;
string s,p;

class cmp1
{
    bool operator()(int x,int y)
    {
        return abs(s[x] - p[x] > s[y] - p[y]);
    }
};

class cmp2
{
    bool operator()(int x,int y)
    {
        return abs(s[x] - p[x] < s[y] - p[y]);
    }
};

void solve()
{
    cin >> s;
    cin >> p;
    priority_queue<int,vector<int>,cmp1> big_heap;
    priority_queue<int,vector<int>,cmp2> small_heap;
    for(int i = 0;i < s.size();i++)
    {
        if(s[i] == p[i]) continue;
        if(s[i] - p[i] < 0) small_heap.push(i);
        else big_heap.push(i);
    }

    while(!big_heap.empty())
    {
        int i = big_heap.top();
        big_heap.pop();
        s[i] = p[i];
        cout << s << endl;;
    }

    while(!small_heap.empty())
    {
        int i = small_heap.top();
        big_heap.pop();
        s[i] = p[i];
        cout << s << endl;;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}